//
//  AppDelegate+UMengSocial.m
//  Chat
//
//  Created by Wangchengshan on 15/11/4.
//  Copyright © 2015年 Wangchengshan. All rights reserved.
//

#import "AppDelegate+UMengSocial.h"
#import "UMMobClick/MobClick.h"

#define UMSYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define _IPHONE80_ 80000

@implementation AppDelegate (UMengSocial)

- (void)setupUMengSocial
{
    
    //友盟统计
    [self umengTrack];
    
    [[UMSocialManager defaultManager] setUmSocialAppkey:UMSocialAppKey];
    
    //新浪
    
//    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_Sina appKey:SinaAppkey  appSecret:SinaAppSecret redirectURL:@"http://sns.whalecloud.com"];
    
    //微信
    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_WechatSession appKey:WXAppkey appSecret:WXAppSecret redirectURL:@""];
    
    //QQ
    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_QQ appKey:QQAppkey  appSecret:QQAppSecret redirectURL:@""];
    
    //设置支持没有客户端情况下使用SSO授权
//    [UMSocialQQHandler setSupportWebView:YES];
    
    
}

- (void)umengTrack {
    
    [MobClick setAppVersion:XcodeAppVersion]; //参数为NSString * 类型,自定义app版本信息，如果不设置，默认从CFBundleVersion里取
    [MobClick setLogEnabled:NO];
    UMConfigInstance.appKey = UMSocialAppKey;
    UMConfigInstance.secret = @"secretstringaldfkals";
    UMConfigInstance.channelId = @"App Store";
    //    UMConfigInstance.eSType = E_UM_GAME;
    [MobClick startWithConfigure:UMConfigInstance];
}

//- (BOOL)setupUMengSocialHandleOpenUrl:(NSURL *)url
//{
//    return  [UMSocialSnsService handleOpenURL:url];
//}

@end
